home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Sample Code / Newton Sample Code 1.2 / Views / Wrap It Up-3 / README.Wrap It Up next >
Encoding:
Text File  |  1994-07-08  |  1.7 KB  |  40 lines  |  [TEXT/R*ch]

  1. Copyright © 1993-94 Apple Computer, Inc. All rights reserved.
  2.  
  3. Wrap It Up        by Bob Ebert and J. Christopher Bell
  4.  
  5.  
  6. This sample illustrates dynamically changing the height of clParagraphViews
  7. based on their contents.  Two ways to do it are illustrated, one using the
  8. vCalculateBounds viewFlag, and one using a new Platforms File function to 
  9. calculate paragraph heights.
  10.  
  11. Using the vCalculateBounds viewFlag:
  12.  
  13. There are some flaws in the current implementation of vCalculateBounds:
  14. 1. SetValue on 'text slot isn't refilling text cache
  15.    (workaround: after the SetValue, do a SetValue on another slot in
  16.     the clParagraphView, e.g., viewBounds)
  17. 2. paragraphview shifts down 5 pixels in your app when adding/deleting
  18.    words
  19.    (workaround: remove viewLineSpacing slot from clEditView and
  20.     set viewFormat of clParagraphView to no lines)
  21. 3. no hilite feedback when selecting text in your app
  22.    (workaround: the text really is selected, so ignore the lack of hilite)
  23.    The sample code turns off gestures so hiliting is not allowed.
  24. 4. if the text is editable, scrubbing all the text can result in an exception
  25.    (To create editable children of clEditViews properly, see the Notarize sample,
  26.     and the Views Q&A.)
  27.  
  28. Calculating the paragraph height yourself:
  29.  
  30. A platforms file function called SimpleTextHeight calculates the height the 
  31. specified text will occupy if displayed in a simple clParagraph view. In other 
  32. words, it can be used with only a single font with no styles array or ViewLineSpacing.
  33.  
  34. Note that previous versions of Wrap It Up included a now-obsolete function for 
  35. calculating text height. You should use the platforms file SimpleTextHeight function
  36. instead of that function for maximum compatibility with future Newton devices.
  37.  
  38.  
  39. modifed Jul 6, 1994
  40.